/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.suli.outHouse.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
* @website https://eladmin.vip
* @description /
* @author wyh
* @date 2024-02-01
**/
@Entity
@Data
@Table(name="order_detail")
public class OrderDetail implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "ID")
    private String id;

    @Column(name = "`order_detail_code`")
    @ApiModelProperty(value = "出库明细单号")
    private String orderDetailCode;

    @Column(name = "`main_id`")
    @ApiModelProperty(value = "主表ID")
    private String mainId;

    @Column(name = "`material_code`")
    @ApiModelProperty(value = "物料编码")
    private String materialCode;

    @Column(name = "`material_name`")
    @ApiModelProperty(value = "物料名称")
    private String materialName;

    @Column(name = "`specification`")
    @ApiModelProperty(value = "规格")
    private String specification;

    @Column(name = "`lot_code`")
    @ApiModelProperty(value = "批次号")
    private String lotCode;

    @Column(name = "`tray_code`")
    @ApiModelProperty(value = "载具")
    private String trayCode;

    @Column(name = "`plan_qty`")
    @ApiModelProperty(value = "计划数量")
    private BigDecimal planQty;

    @Column(name = "`act_qty`")
    @ApiModelProperty(value = "实际数量")
    private BigDecimal actQty;

    @Column(name = "`unit_code`")
    @ApiModelProperty(value = "单位")
    private String unitCode;

    @Column(name = "`location_code`")
    @ApiModelProperty(value = "库位号")
    private String locationCode;

    @Column(name = "`warehouse_code`")
    @ApiModelProperty(value = "仓库号")
    private String warehouseCode;

    @Column(name = "`serial_number`")
    @ApiModelProperty(value = "序列号")
    private String serialNumber;

    @Column(name = "`create_by`")
    @ApiModelProperty(value = "创建用户")
    private String createBy;

    @Column(name = "`update_by`")
    @ApiModelProperty(value = "修改用户")
    private String updateBy;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "修改日期")
    private Timestamp updateTime;

    @Column(name = "`zone`")
    @ApiModelProperty(value = "仓位")
    private String zone;

    @Column(name = "`type`")
    @ApiModelProperty(value = "类型")
    private String type;


    @Column(name = "`su_no`")
    @ApiModelProperty(value = "供应商代码")
    private String suNo;

    @Column(name = "`status`")
    @ApiModelProperty(value = "状态")
    private int status;

    public void copy(OrderDetail source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
